# Create your views here.

from discography.models import Publication, Publisher, Track

from django.views.generic import list_detail, simple #Generic views ForTheWin



def publications_listByYear(request, year, paginate_by, queryset, allow_empty):
    thisyear = year
    return list_detail.object_list(
        request,
        extra_context = { 'year': thisyear, 'page_title': thisyear, 'page_type': 'year' },
        #queryset = Publication.objects.filter(year=year, is_visible_yearly=True),
        queryset = Publication.objects.filter(year=year),
        allow_empty = True,
    )

def publications_listAll(request, paginate_by, queryset, allow_empty):
    return list_detail.object_list(
        request,
		queryset=queryset,
        allow_empty = True,
    )
    
def publication_single(request, slug):
    thisslug = slug
    return list_detail.object_detail(
        request,
        queryset = Publication.objects.all(),
        slug = thisslug,
        slug_field = "slug"
    )    